namespace Isolation.TeamFoundationServer
{
	#region #using Directives

	using System.Threading;

	#endregion

	internal class CancelableAsyncResult : ICancelableAsyncResult
	{
		private readonly Microsoft.TeamFoundation.Client.ICancelableAsyncResult car;

		public CancelableAsyncResult(Microsoft.TeamFoundation.Client.ICancelableAsyncResult car)
		{
			this.car = car;
		}

		#region Implementation of IAsyncResult

		public bool IsCompleted
		{
			get { return this.car.IsCompleted; }
		}

		public WaitHandle AsyncWaitHandle
		{
			get { return this.car.AsyncWaitHandle; }
		}

		public object AsyncState
		{
			get { return this.car.AsyncState; }
		}

		public bool CompletedSynchronously
		{
			get { return this.car.CompletedSynchronously; }
		}

		#endregion

		#region Implementation of ICancelableAsyncResult

		public Microsoft.TeamFoundation.Client.ICancelableAsyncResult TfsObject
		{
			get { return this.car; }
		}

		public void Cancel()
		{
			this.car.Cancel();
		}

		public bool IsCanceled
		{
			get { return this.car.IsCanceled; }
		}

		#endregion
	}
}